package negocio;


import modelo.Usuario;

import org.hibernate.SessionFactory;
import org.hibernate.cfg.AnnotationConfiguration;
import org.hibernate.cfg.Configuration;


public final class HibernateUtil {

    private static SessionFactory sessionFactory;

    private static Configuration cfg;
    
    private HibernateUtil() {
    }
   
    static{
        cfg=new AnnotationConfiguration()
        .addAnnotatedClass(Usuario.class);
        cfg.configure("hibernate.cfg.xml");
        sessionFactory = cfg.buildSessionFactory();
    }
    
    public static SessionFactory getSessionFactory(){
        return sessionFactory;
    }
}
